package com.qf.utils;

import lombok.Data;

@Data
public class JsonResultUtil {

    private Integer code;
    private String msg;
    private Long count;
    private Object data;

    //成功返回
    public static JsonResultUtil success(){

        JsonResultUtil jsonResultUtil = new JsonResultUtil();
        jsonResultUtil.setCode(0);
        jsonResultUtil.setMsg("success");

        return jsonResultUtil;
    }

    //失败返回
    public static JsonResultUtil fail(){

        JsonResultUtil jsonResultUtil = new JsonResultUtil();
        jsonResultUtil.setCode(-1);
        jsonResultUtil.setMsg("fail");

        return jsonResultUtil;
    }

}
